/*
 *  lib-smv: Matrix - Vector Library targeted to Structural Mechanics Problems
 *  Copyright (C) 2006-2008  St.Brcic, Lj.Zugic
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
/** @file SMV_Lib.cpp
 *  @brief Main cpp file for testing the library
 *
 *  Presently, it is used for generation of a Win32 Static Lib
 *  using Dev-C++ 4.9.9.2 
 */

#include <cstdlib>
#include <iostream>
#include <cmath>
#include "SMV_Lib.h"

using namespace std;
using namespace smv_lib;

// #if 0

int main(void)
{
	    Matrix A("Matrix-A.txt");       
        Vector b("Vector-b.txt");
        Vector x;
        LinEqs le(A,b);
        cout << "Solution of equations A x = b\n" << "===================" << endl;
        cout << "Coefficient Matrix A = \n" << A << endl;
        cout << "Free terms b =\n" << b << endl;
        le.solveProblem();
        x = le.getSolution();
        cout << "The solution of eqs. is: x = \n" << x << endl;
        le.WriteTo("Solution.txt");
        double norm, A_norm;
        norm = x.Norm();
        A_norm = x.B_Norm(A);
        cout << "Intensity of vector x = " << norm << endl;
        cout << "B Norm of vector x with matrix A is " << A_norm << endl;
	    
        cout << "It is over now " << endl;
        system("PAUSE");
}

// #endif // if 0
//================================= end of file
